#!/usr/bin/env python
#coding:utf-8

import cgi
import cgitb
import htmlheader
cgitb.enable()

form = cgi.FieldStorage()
if not form.has_key("name"):
    print "Location: /wiki/google.py\n"
else:
    htmlheader.htmlheader("Bug2Bug Travel")
    print "<h1>Welcome, %s!</h1>" % form["name"].value
    print """<p>Here are our weekly specials:<br /></p>
    <ul><li>Boston to Taiwan for $300</li></ul>"""

if not form.has_key("password"):
    print """<p style="font-style: italic">
    Become a member today for more great deals!</p>"""
elif form["password"].value == "Coast2Coast":
    print """<hr />
    <p>Current specials just for members:<br /></p>
    <ul><li>San Diego to Hong Kong for $250</li></ul>"""
else:
    print """<p style="font-style: italic">
    Sorry, you have entered the wrong password.
    if you have the coorrect password, enter
    it to see more specials.</p>"""

htmlheader.htmlend()
